package com.zdxlz.fcmp.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zdxlz.fcmp.common.mybatis.enums.HandleStatusEnum;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 任务表
 * </p>
 *
 * @author: aman
 * @since 2025-02-08
 */
@Data
@TableName("task")
public class TaskEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 消息ID
     */
    @TableId("message_id")
    private String messageId;


    /**
     * 设备MAC
     */
    @TableField("mac")
    private String mac;


    /**
     * MQTT topic
     */
    @TableField("topic")
    private String topic;

    /**
     * MQTT payload
     */
    @TableField("payload")
    private String payload;

    /**
     * 任务状态，如：TaskStatusEnum
     */
    @TableField("status")
    private HandleStatusEnum status;

    /**
     * 重试次数
     */
    @TableField("retry_count")
    private Integer retryCount;

    /**
     * 最后一次执行时间
     */
    @TableField("last_exec_time")
    private LocalDateTime lastExecTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

}
